#!/bin/bash
rootPath=/root/HPMQ/distributedMQ
buildPath=${rootPath}/build

perfDataFile=$(basename "$1")
filePrefix=${perfDataFile%.*}

pprof --collapsed ${buildPath}/example/broker ${buildPath}/${filePrefix}.prof > ${buildPath}/${filePrefix}.folded

/opt/FlameGraph/flamegraph.pl ${buildPath}/${filePrefix}.folded > ${buildPath}/${filePrefix}.svg
